﻿@model WebUI.Models.QizSmsSubject
@using (Ajax.BeginForm(new AjaxOptions()
{
    LoadingElementId="OnLoadingSpan",UpdateTargetId = ViewBag.utid,
    InsertionMode = InsertionMode.Replace,
    HttpMethod = "Post"
    ,
    OnSuccess = "$('#dialogbox').dialog('close');",
    OnFailure = "OnSiteError"
}))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>基本信息</legend>

        @Html.HiddenFor(model => model.ID)
        @Html.HiddenFor(model => model.DoctorID)
        <table width="100%">
            <tr>
                <td>
                    @Html.EditorFor(model => model.Title, "TxtField")
                </td>
                <td>
                    @Html.EditorFor(model => model.SubjectID, "SelField", new { Selects = new SelectList(ViewBag.Subjects, "ID", "Title", Model.SubjectID) })
                </td>
            </tr>
            <tr>
                <td>
                    <div class="editor-label">
                        @Html.LabelFor(model => model.MsgTemplateForFine)                        
                        @Ajax.ActionLink("[模板]", "ImportSmsTemplate", new { type = "诊断正常短信",insertId="normalSms" }, new AjaxOptions() { UpdateTargetId = "smsTemplate", HttpMethod = "Get", Confirm = "" })
                    </div>                    
                    <div class="editor-field">
                        @Html.TextAreaFor(model => model.MsgTemplateForFine, 5, 30, new { id = "normalSms" })
                        @Html.ValidationMessageFor(model => model.MsgTemplateForFine)
                    </div>                    
                    
                </td>
                <td>
                    <div class="editor-label">
                        @Html.LabelFor(model => model.MsgTemplateForBad)                        
                        @Ajax.ActionLink("[模板]", "ImportSmsTemplate", new { type = "诊断异常短信", insertId="badSms" }, new AjaxOptions() { UpdateTargetId = "smsTemplate", HttpMethod = "Get", Confirm = "" })
                    </div>                    
                    <div class="editor-field">
                        @Html.TextAreaFor(model => model.MsgTemplateForBad, 5, 30, new { id = "badSms" })
                        @Html.ValidationMessageFor(model => model.MsgTemplateForBad)
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div id="smsTemplate"></div>
                    <div class="editor-label">
                        @Html.LabelFor(model => model.RecuperInvitMsg)                        
                        @Ajax.ActionLink("[模板]", "ImportSmsTemplate", new { type = "发起邀请",insertId="InvitSms" }, new AjaxOptions() { UpdateTargetId = "smsTemplate", HttpMethod = "Get", Confirm = "" })
                    </div>                    
                    <div class="editor-field">
                        @Html.TextAreaFor(model => model.RecuperInvitMsg, 5, 30, new { id = "InvitSms" })
                        @Html.ValidationMessageFor(model => model.RecuperInvitMsg)
                    </div>
                </td>
                <td>
                    <div class="editor-label">
                        @Html.LabelFor(model => model.SmsYinDaoYue)                        
                        @Ajax.ActionLink("[模板]", "ImportSmsTemplate", new { type = "短信随访开始问候语", insertId = "YinDaoYueSms" }, new AjaxOptions() { UpdateTargetId = "smsTemplate", HttpMethod = "Get", Confirm = "" })
                    </div>                    
                    <div class="editor-field">
                        @Html.TextAreaFor(model => model.SmsYinDaoYue, 5, 30, new { id = "YinDaoYueSms" })
                        @Html.ValidationMessageFor(model => model.RecuperInvitMsg)
                    </div>
                </td>
            </tr>
        </table>           
        <br />
        <div class="tips" >
            <b>短信模板说明：</b> 
            短信提醒文本中支持模板功能， 可以使用的模板标记有：<br/>{医院}&nbsp;&nbsp;&nbsp;{科室}&nbsp;&nbsp;&nbsp;{随访}&nbsp;&nbsp;&nbsp;{医生}&nbsp;&nbsp;&nbsp;{医生电话}<br/>
            {主管医生}&nbsp;&nbsp;&nbsp;{主管医生电话}&nbsp;&nbsp;&nbsp;输入时包含大扩号。 短信发送时模板标记会被自动生成对应的内容。如{医院}在发送是会转换成当前医院的名称。
        </div>  
        <div style="float:right">          
            <p>
                <input type="submit" value="确定"  />
            </p>
        </div>        
    </fieldset>
}